package com.xiaozhuai.controller;

import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/hello")
public class HelloController {

    @GetMapping(value = "/h1")
    public String hello(@NotNull Model model){
        //封装数据
        model.addAttribute("msg","SpringMVCAnnotation!");
        return "hello";//会被视图解析器处理
    }
}
